With development of the field of electronic device technologies, and in particular, with popularization of photographing devices, a user imposes a higher requirement on a focusing speed in a photographing process. Currently, commonly used focus algorithms mainly include active focusing and passive focusing. The active focusing may be specifically completed by using a ranging method, and the passive focusing may be specifically completed by using a hill climbing method. In the hill climbing method, focusing is completed mainly by analyzing definition of images corresponding to all lens positions, finding a lens position with maximum contrast, and using the lens position as a lens position corresponding to an in-focus image. In the ranging method, focusing is completed mainly by calculating, according to an object distance, a lens position corresponding to an in-focus image, and moving a voice coil motor (English: Voice Coil Motor, VCM for short) to enable the VCM to reach the specified lens position. In a process of completing focusing by using the hill climbing method, images obtained by moving a VCM to multiple lens positions need to be obtained, and definition of all the images is compared and analyzed, that is, a lot of time needs to be consumed for completing a hill climbing method-based focusing solution. Therefore, to quickly and accurately complete focusing, the ranging method with relatively high costs is usually used to implement a focusing process. In a process of performing focusing by using the ranging method, an object distance may be measured in a binocular ranging manner or a laser ranging manner. A ranging range can reach two meters by means of binocular ranging, and in comparison with a laser ranging process, ranging of an entire image can be completed by means of binocular ranging. Therefore, an object distance of an image subject is usually calculated by means of binocular ranging, and then a VCM is moved to enable the VCM to reach a specified lens position, so as to complete an active focusing process.
However, the binocular ranging has limitations, for example, precision is extremely poor in a case of an object under low illuminance, in a flat area, and with repeated patterns. Ranging precision is relatively low when a VCM position is relatively far from an in-focus location. Overall ranging precision is lower than laser ranging precision. Therefore, when an object in a focusing window has a relatively weak texture, for example, a white wall or a blue sky, or when an object in a focusing window has repeated patterns, for example, a plaid shirt, in these scenarios, it is very likely to obtain incorrect depth information if active focusing is completed by means of binocular ranging in combination with a VCM. Consequently, a focusing process fails, and focusing process precision is greatly reduced.